package com.bwf.string;

import java.nio.charset.StandardCharsets;

/**
 * @Version v1.0
 * @Description: TODO
 * @Author ZHANZHONGXIN
 * @Date 2022/5/12 11:20
 * @Copyright 博为峰
 */
public class StringDemo01 {

    public static void main(String[] args) {
        //ctrl + alt + m
//        m1();
        //字符串常量池
        String s1 = "abc";
        String s2 = "cba";
        String s3 = "abc";
        s1 = "123";
        System.out.println(s1 == s2);
        System.out.println(s1 == s3);

    }

    private static void m1() {
        String s1 = new String();
        System.out.println("s1 = " + s1);

        byte[] bytes = {97, 98, 99};
        String s2 = new String(bytes, StandardCharsets.UTF_8);
        System.out.println("s2 = " + s2);
    }
}
